const HtmlWebpackPlugin = require('html-webpack-plugin');
const fs = require('fs');

function getTemplat() {
    let templateHtmlFiles = __dirname + '/temp/';
    let files = fs.readdirSync(templateHtmlFiles);

    return files.map(filename => {
        let template = templateHtmlFiles + filename;
        let key = filename.split('.')[0];
        return new HtmlWebpackPlugin({
            filename,
            template,
            chunks: ['vendor', 'm_' + key]
        })
    })
}

module.exports = getTemplat




